package com.aishua.andpaydemo;

import android.content.Context;
import android.content.SharedPreferences;

/**
 * Created by aishua on 2018/5/19.
 */

public class ThemeHelper {

    private static final String CURRENT_THEME = "theme_current";
//   主题色
    public static final int PURPLE = 0x1;
//    粉色
    public static final int PINK = 0x2;
//    蓝色
    public static final int BLUE = 0x3;
//    绿色
    public static final int GREEN = 0x4;
//    红色
    public static final int RED = 0x5;
//    黄色
    public static final int YELLOW = 0x6;

    public static SharedPreferences getSharePreference(Context context) {
        return context.getSharedPreferences("multiple_theme", Context.MODE_PRIVATE);
    }

    public static void setTheme(Context context, int themeId) {
        getSharePreference(context).edit()
                .putInt(CURRENT_THEME, themeId)
                .commit();
    }

    public static int getTheme(Context context) {
        return getSharePreference(context).getInt(CURRENT_THEME, PURPLE);
    }

    public static boolean isDefaultTheme(Context context) {
        return getTheme(context) == PURPLE;
    }

    public static String getName(int currentTheme) {
//        switch (currentTheme) {
//            case CARD_SAKURA:
//                return "THE SAKURA";
//            case CARD_STORM:
//                return "THE STORM";
//            case CARD_WOOD:
//                return "THE WOOD";
//            case CARD_LIGHT:
//                return "THE LIGHT";
//            case CARD_HOPE:
//                return "THE HOPE";
//            case CARD_THUNDER:
//                return "THE THUNDER";
//            case CARD_SAND:
//                return "THE SAND";
//            case CARD_FIREY:
//                return "THE FIREY";
//        }
        return "THE RETURN";
    }
}
